<?
	include('classes/clsDB.php');
	session_start();
	if($_GET['logout']){
		session_start();
		session_unset();
		session_destroy();
		$_SESSION = array();
		$Message="You are now logged out";
	}
	
	$r= new ReturnRecord();  // base object for returning data or raw queries
	
	if($_POST['Submit']){
		$data=$r->rawQuery("SELECT id,contactName FROM affiliate where email='$_POST[email]' and password='$_POST[password]'");
		$dataarray=mysql_fetch_array($data);
		$AdminKey=$dataarray[0];
		
		if($AdminKey>0){ //admin login ok
			
			$_SESSION["AffKey"]=$AdminKey;
			$_SESSION["Name"]=$dataarray[1];
			header("Location: affiliates/home.php");
		}else{	//admin login bad
			$Message="Incorrect Username or Password";
		};
	};
?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Accommodation Affiliate Program Make Money Online</title>

<link href="css/general.css" rel="stylesheet" type="text/css">
<link href="css/counter.css" rel="stylesheet" type="text/css">
<script src="jscript/general.js" type="text/JavaScript"></script>
</head>

<body onLoad="MM_preloadImages('images/web/want2go-roll.gif','images/web/ask2go-roll.gif','images/web/deals2go-roll.gif')">

<div id="headerHolder">
  <?php include("header.php"); ?>
</div>
<div id="contentHolder">
  <table width="970" border="0" cellspacing="15" cellpadding="0">
    <tr>
      <td valign="top"><p class="pageTitle">Bubble Affiliate Program </p>
        <p><strong>Do you want to earn money by selling accommodation from your web site?</strong></p>
        <p>With  online accommodation bookings now a multi billion dollar industry that  is growing exponentially year by year you will need to take advantage  of the Bubble Affiliate Program.<br>
            <br>
          Here is a  great opportunity for you to maximize your income potential from your  website. Just join the Bubble Affiliate Program and every time that a  click through link from your website generates a qualified confirmed  booking you will earn a referral fee of  10%. Your referral fees  will add up quickly, we make it easy for you to track your referral  fees through the systems tracking and monitoring software you will be  able to view your click throughs and sales. </p>
        <p>The Bubble Affiliate Program offers a large range of quality hotels, resorts and apartments throughout Australia and overseas.</p>      </td>
      <td width="260" valign="top"><p class="pageTitle">Become An Affiliate</p>
        <p>Start earning commission now! </p>
        <p><a href="affiliate-signup.php">CLICK HERE</a> to sign up or call 1300 CLICK2GO </p>
        <p class="pageTitle">Affiliate Login</p>
      <p>Enter Your Affilate Account Login Details</p><?=$Message;?>
      <form name="form1" method="post" action="affiliates.php">
        <table border="0" align="center" cellpadding="0" cellspacing="10">
          <tr>
            <td>Email Address </td>
            <td><input type="text" name="email" size="20" class="formTextFields"></td>
          </tr>
          <tr>
            <td>Password</td>
            <td><input type="password" name="password" size="20" class="formTextFields"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input name="Submit" type="submit" class="formButton"  value="Login"></td>
          </tr>
        </table>
        </form>
      </td>
    </tr>
  </table>
</div>

<div id="footer"><?php include("footer.php"); ?></div>

</body>
</html>
